package design.observer;

/**
 * 核心思想：每个处理环节，都有一个“指针”指向下一个处理者，类似链表一样。
 */
public abstract class AbstractProcessor implements Processor {

    private Processor next;

    public AbstractProcessor(Processor processor) {
        this.next = processor;
    }

    @Override
    public Processor getNextProcessor() {
        return next;
    }

    @Override
    public abstract void process(String param);
}